import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  //重定向
  {
    path: "/",
    redirect: "/home",
  },

  //首页路由--李肖
  {
    path: "/home",
    name: "home",
    component: () => import("@/layout/home/Home.vue"),
  },
  {
    path: "/city",
    component: () => import("@/views/Home/City.vue"),
  },
  {
    path: "/detail",
    component: () => import("@/views/Home/Detail.vue"),
  },
  {
    path: '/speak',
    component: () => import('@/views/Home/Speak.vue')
  },
  {
    path: '/search',
    component: () => import('@/views/Home/Search.vue')
  },

  //新品--蒋家
  {
    path: "/newpro",
    name: "newpro",
    component: () => import("@/views/Newpro"),
  },

  //购物车路由--宋科
  {
    path: "/cart",
    name: "cart",
    component: () => import("@/views/Cart"),
  },
  {
    path: "/address",
    name: "address",
    component: () => import("@/views/Cart/address"),
  },
  {
    path: "/addAddress",
    name: "addAddress",
    component: () => import("@/views/Cart/addAddress"),
  },
  {
    path: "/order",
    name: "order",
    component: () => import("@/views/Cart/order"),
  },
  {
    path: "/emptycart",
    name: "emptycart",
    component: () => import("@/views/Cart/emptyCart.vue"),
  },
  //我的--刘鹏
  {
    path: "/my",
    component: () => import("@/views/Mine"),
  },
  {
    path: "/myset",
    component: () => import("@/views/Mine/TopSet/mySet.vue"),
  },
  {
    path: "/myinformation",
    component: () => import("@/views/Mine/TopSet/myInformation.vue"),
  },
  {
    path: "/mysafe",
    component: () => import("@/views/Mine/TopSet/mySafe.vue"),
  },
  {
    path: "/changeusername",
    component: () => import("@/views/My/changeUsername"),
  },

  {
    path: "/login",
    component: () => import("@/views/Mine/Login"),
  },
  {
    path: "/register",
    component: () => import("@/views/Mine/Register"),
  },
  {
    path: "/mycollect",
    component: () => import("@/views/Mine/Collect"),
  },

  //错误路由的处理
  {
    path: "*",
    component: () => import("@/views/Error404.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
